import { findTypeByValue, findTypeByLabel } from '@/utils/findType'
import * as types from "./types"

// 渠道Table
export const configTableFrame = [
  { 
    prop: "num", 
    label: "序号", 
    minWidth: "50px", 
    tooltip: true 
  },
  {
    prop: "name",
    label: "任务名称",
    minWidth: "200px"
  },
  { 
    prop: "type", 
    label: "任务类型",
    minWidth: "100px",
    formatter: (row) => {
      return findTypeByValue(row.type, types.taskType);
    }
  },
  {
    prop: "score",
    label: "积分",
    minWidth: "100px"
  },
  {
    prop: "totalNum",
    label: "医生体验总数",
    minWidth: "100px"
  },
  {
    prop: "enabled",
    label: "启用",
    minWidth: "100px",
    formatter: (row) => {
      return findTypeByValue(row.enabled, types.enableType);
    }
  },
  {
    prop: "sortNo",
    label: "排序",
    minWidth: "100px"
  },
  { 
    label: "操作", 
    slotName: "operate", 
    fixed: "right",
    minWidth: "150px"
  },
];


export const searchFrame = [
  { 
    label: "任务名称", 
    key: "name", 
    type: 1
  }
]
